using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace AMStudio.UserInterface
{
    public partial class DlgProgress : Form
    {
        public void SetMaximum(int value) { this.progressBar.Maximum = value; }
        public void SetMinimum(int value) { this.progressBar.Minimum = value; }
        public void SetStep(int value) { this.progressBar.Step = value; }
        public void SetText(string value) { this.label.Text = value; }
        public void SetTitle(string value) { this.Text = value; }
        public void DoStep(int count)
        {
            int oldStepcount = progressBar.Step;
            progressBar.Step = count;
            this.progressBar.PerformStep();
            progressBar.Step = oldStepcount;
        }
        public void DoStep()
        {
            progressBar.PerformStep();
            this.Refresh();
            //this.Owner.Refresh();
        }

        public void ReportStep(int step)
        {
            if (step <= this.progressBar.Maximum)
            {
                this.progressBar.Value = step;
            }
        }

        public DlgProgress()
        {
            InitializeComponent();
        }
    }
}